@using EShopOnAbp.Localization
@using EShopOnAbp.PublicWeb.Components.Purchase
@using Microsoft.Extensions.Localization
@model PurchaseWidgetViewComponent.PurchaseViewModel
@inject IStringLocalizer<EShopOnAbpResource> L

@{
    var totalCount = Model?.Basket.Items.Count ?? 0;
    var totalPrice = Model.Basket.TotalPrice;
    var demoDiscountPercentage = 0;
    var discountTotal = totalPrice * demoDiscountPercentage / 100;
    var grandTotal = totalPrice - discountTotal;
}
<div class="card">
    <div class="card-body">
        <div style="text-align: center; padding-top: 25px" >
            <div class="row">
                <h5>@L["TotalSelected", totalCount]</h5>
            </div>
            <div class="row">
                <h3>$@totalPrice.ToString("0.00")</h3>
            </div>
        </div>
        <hr/>
        <div class="row">
            <h3>@L["Purchase:OrderSummary"]</h3>
        </div>
        <div class="summary">
            <div class="row">
                <div class="col-md-7">@L["Purchase:Products"]:</div>
                <div class="col-md-5 m-result">@totalPrice.ToString("0.00") $</div>
            </div>
            <div class="row">
                <div class="col-md-7">@L["Purchase:CargoAndPackaging"]:</div>
                <div class="col-md-5 m-result">0.00 $</div>
            </div>
            <div class="row">
                <div class="col-md-7">@L["Purchase:Total"]:</div>
                <div class="col-md-5 m-result">@totalPrice.ToString("0.00") $</div>
            </div>
            <div class="row">
                <div class="col-md-7">@L["Purchase:GiftCards"]:</div>
                <div class="col-md-5 m-result">@discountTotal.ToString("0.00") $</div>
            </div>
        </div>
        <hr/>
        <div class="row">
            <div class="col-md-7">
                <h5>@L["Purchase:OrderTotal"]:</h5>
            </div>
            <div class="col-md-5 m-result order-total">
                <h5>@grandTotal.ToString("0.00") $</h5>
            </div>
        </div>
        <div class="row" style="padding: 25px; text-align: center">
            <form method="post">
                @Html.AntiForgeryToken()
                <input type="hidden" name="model.TotalDiscountPercentage" class="total-discount" data-discount-total="@demoDiscountPercentage" value="@demoDiscountPercentage" />
                <abp-button type="submit" size="Large" class="basket-purchase-button" text="@L[Model.ButtonDescription]" button-type="Warning"/>
            </form>
        </div>
    </div>
</div>